package com.matt.foundation.model;

import com.matt.commons.dto.sso.StaffDTO;
import com.matt.remoteCall.SsoCallService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author: Fablenas
 */
@Component("memVerificationCache")
@Slf4j
public class MemVerificationCache {

    @Autowired
    private SsoCallService ssoCallService;

    public String getStaffId( String ticket) {
        return getStaff(ticket).getId();
    }

    public String getAreaId( String ticket) {
        return getStaff(ticket).getAreaId();
    }

    public StaffDTO getStaff(String ticket) {
        return ssoCallService.getStaffDTO(ticket);
    }

}
